package com.jl.api;

import com.alibaba.fastjson.JSONObject;
import com.jl.model.ChcRoomInfo;
import com.jl.model.WaCherInfo;
import com.jl.model.req.RoomIntoReq;
import com.jl.model.socket.RoomDetail;
import io.netty.channel.ChannelHandlerContext;

import java.util.concurrent.ConcurrentHashMap;

public interface CommonApi {
    
    Object getParam();

    Object createRoom(Object object);

    Object recordQuery();

    Object getRoomDetail(Integer roomId);

    Object playGame(RoomIntoReq roomIntoReq, RoomDetail roomDetail, ChannelHandlerContext channelHandlerContext,
                    ConcurrentHashMap<ChannelHandlerContext, ChcRoomInfo> chcRoom,ConcurrentHashMap<ChannelHandlerContext, WaCherInfo> waCher);  //返回用户详情

    Object review(Integer roomId);

    void quit(ChcRoomInfo chcRoomInfo,RoomDetail roomDetail,ChannelHandlerContext channelHandlerContext);

    void trusteeship(ChcRoomInfo chcRoomInfo,RoomDetail roomDetail,ConcurrentHashMap<ChannelHandlerContext, ChcRoomInfo> chcRoom) throws InterruptedException;

    default String toJsonString(Object object){
        return JSONObject.toJSONString(object);
    }

    void watcherQuit(WaCherInfo waCherInfo, RoomDetail roomDetail, ChannelHandlerContext ctx);
}
